package problems.solved;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import utils.Utils;

public class Problem4 {
	public static void main(String[] args) {
		List<Integer> list = new ArrayList<Integer>();
		for (int a = 100; a < 1000; a++) {
			for (int b = a+1; b < 1000; b++) {
				if (Utils.isPalindrome(a*b)) {
					list.add(a*b);
				}
			}
		}
		Collections.sort(list);
		System.out.printf("Found %d palindromes, largest is %d%n", list.size(), list.get(list.size()-1)); // 906609
	}
}
